//
//  SongListSongsModel.m
//  YHYRealx
//
//  Created by yanghuiyan on 16/5/4.
//  Copyright © 2016年 yanghuiyan. All rights reserved.
//

#import "SongListSongsModel.h"
#import "SongListSongsImageModel.h"
#import "SongListSongsDetailModel.h"
@implementation SongListSongsModel

- (instancetype)initWithDataSource:(NSDictionary *)dataSource {
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:dataSource];
        NSMutableArray *array = [NSMutableArray array];
        for (NSDictionary *dic in self.songs) {
            SongListSongsDetailModel *songsModel = [[SongListSongsDetailModel alloc] initWithDataSource:dic];
            [array addObject:songsModel];
        }
        self.songs = [NSMutableArray arrayWithArray:array];
    }
    return self;
}
- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"image"]) {
        self.image = [[SongListSongsImageModel alloc] initWithDataSource:value];
    }
    if ([key isEqualToString:@"data"]) {
        self.songs = value;
    }
    if ([key isEqualToString:@"songList"]) {
        self.songs = value;
    }
    
}



@end
